	<script type="text/javascript">var formAction = '<?php echo base_url().index_page();?>/submenu';</script>
	<script type="text/javascript" src="<?php echo app_asset_url(); ?>js/submenu.js"></script>	
	<!-- Background wrapper -->
	<div id="bgwrap">

		<!-- Main Content -->
		<div id="content">
			<div id="main">	
			
			<h1>Sub Menu</h1>
			<div class="pad20">			
					<p>List dari sub menu</p>
					<p>
						<a href="#" class="button tooltip" title="Tambah sub menu baru" id="add-button"><span class="ui-icon ui-icon-plusthick"></span>Add</a>
						<a href="#" class="button tooltip" title="Hapus sub menu yang di pilih"  id="delete-selected"><span class="ui-icon ui-icon-trash"></span>Remove</a>
					</p>					
					<div id="add-dialog" title="Add/Edit">
						<!-- Form -->
						<form id="add" method="post" enctype="multipart/form-data">
							<p>
								<label for="dropdown">Main Menu: </label>
								<select name="id_main" class="dropdown">
									<option value="">Please select an option</option>
									<?php foreach($mainmenus as $main){?>
									<option value="<?php echo $main['id_main']?>"><?php echo $main['nama_menu']?></option>
									<?php } ?>
								</select>
							</p>	
							<p>
								<label for="sf">Nama Sub Menu: </label>
								<input class="sf" name="nama_sub" type="text" value="" />
							</p>
							<p>
								<label for="sf">URL Sub Menu: </label>
								<input class="sf" name="link_sub" type="text" value="" />
							</p>
							<p>
								<label for="sf">Order Sub Menu: </label>
								<input class="sf" name="order_sub" type="text" value="" />
							</p>
							<p>
								<label for="dropdown">Type Sub Menu: </label>
								<select name="aktif" class="dropdown" id="aktif">
									<option value="Y">Web Menu</option>
									<option value="N">Admin Menu</option>									
								</select>

								<input name="adminsubmenu" type="hidden" value="" id="adminsubmenu"/>
							</p>							
						</form> 
						
					</div>		

					<div id="delete-dialog" title="Delete Confirmation">
						<!-- Form -->
						<form id="delete" method="post" enctype="multipart/form-data">							
							<p>
								Are you sure you want to delete this item ?
							</p>
						</form> 
						
					</div>		

					<table class="normal" cellpadding="0" cellspacing="0" border="0">
						<thead>
							<tr>
								<td><input type="checkbox" class="checkall" /></td>
								<td>No.</td>
								<td>Main Menu</td>
								<td>Nama Menu</td>
								<td>URL Menu</td>
								<td>Order Menu</td>
								<td>Aktif Menu</td>
								<td>Admin Menu</td>
								<td>Action</td>
							</tr>
						</thead>
						<tbody>
							<?php foreach($grid as $idx=>$item) { ?>
							<tr class="<?php echo ($idx%2 == 0 ? 'even' : 'odd')?>" id="row-<?php echo $item['id_sub']?>">
								<td><input type="checkbox" name="<?php echo $item['id_sub']?>" class="checksel"/></td>
								<td><?php echo $idx+1?></td>
								<td><?php echo $item['nama_menu']?></td>
								<td style="display: none;"><?php echo $item['id_main']?></td>
								<td><?php echo $item['nama_sub']?></td>
								<td><?php echo $item['link_sub']?></td>
								<td><?php echo $item['order_sub']?></td>
								<td><?php echo $item['aktif']?></td>
								<td><?php echo $item['adminsubmenu']?></td>
								<td><ul id="icons" class="ui-widget ui-helper-clearfix">
									<!-- <li class="ui-state-default ui-corner-all" title="Aktifkan"><span class="ui-icon ui-icon-check"></span></li>
									<li class="ui-state-default ui-corner-all" title="Matikan"><span class="ui-icon ui-icon-power"></span></li>
									<li><span class="ui-icon ui-icon-grip-dotted-vertical"></span></li> -->
									<li class="ui-state-default ui-corner-all" title="Edit Banner"><span class="ui-icon ui-icon-pencil edit" val="<?php echo $item['id_sub']?>"></span></li>
									<li class="ui-state-default ui-corner-all" title="Delete Banner"><span class="ui-icon ui-icon-close delete" val="<?php echo $item['id_sub']?>"></span></li>
									</ul>
								</td>
							</tr>
							<?php } ?>
														
						</tbody>
					</table>
			</div>
		</div>
		<!-- End of Main Content -->
		
		
	</div>
	<!-- End of bgwrap -->



